Skip to content

docs: add observability guide for OpenTelemetry tracing and logging - #14462

Draft
jinseopkim0 wants to merge 9 commits into
mainfrom
docs-observability-guide
Draft

jinseopkim0 wants to merge 9 commits into
mainfrom
docs-observability-guide

Conversation

@jinseopkim0

Copy link
Copy Markdown
Contributor

This PR adds a developer documentation guide for OpenTelemetry tracing and structured logging correlation in Google Cloud Java client libraries.

Source-Link: b/564461795

@jinseopkim0

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive observability guide (OBSERVABILITY.md) explaining how to configure OpenTelemetry tracing and SLF4J logging in Google Cloud Java client libraries, and updates the README.md to link to it. Feedback on the guide points out that the OpenTelemetry initialization code snippet contains an unused import and fails to handle a checked IOException thrown by TraceExporter.createWithDefaultCredentials(), which would cause compilation errors. A code suggestion is provided to wrap the snippet in a method handling the exception and clean up the imports.

Comment thread OBSERVABILITY.md Outdated

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Observability guide (OBSERVABILITY.md) that explains how to configure OpenTelemetry tracing and SLF4J logging in Google Cloud Java client libraries, and updates the main README.md to link to it. The review feedback identifies two issues in the guide's Java code examples: an unused import of GlobalOpenTelemetry and an incorrect method call on TraceExporter, which should be changed to createWithDefaultConfiguration() to ensure the example is correct and functional.

Comment thread OBSERVABILITY.md Outdated
Comment thread OBSERVABILITY.md Outdated
@jinseopkim0

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new observability guide (OBSERVABILITY.md) explaining how to configure OpenTelemetry tracing and SLF4J logging in Google Cloud Java client libraries, and updates the README.md to link to it. A review comment points out that the guide incorrectly uses setApiTracerFactory instead of setTracerFactory in the code example, which would result in a compilation error.

Comment thread OBSERVABILITY.md Outdated
@jinseopkim0

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Observability Guide (OBSERVABILITY.md) that explains how to configure OpenTelemetry tracing and SLF4J logging in Google Cloud Java client libraries, and updates the main README.md to link to this guide. The review feedback suggests returning OpenTelemetrySdk instead of OpenTelemetry in the initialization example to allow proper closing of the SDK and prevent span loss upon application exit.

Comment thread OBSERVABILITY.md Outdated
@jinseopkim0

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new OBSERVABILITY.md guide detailing how to configure tracing and logging using OpenTelemetry and SLF4J in Google Cloud Java client libraries, along with a reference link in README.md. Feedback on the new guide highlights two issues in the code snippets: an unused import (io.opentelemetry.api.OpenTelemetry) in the initialization example, and a compilation error where setApiTracerFactory should be used instead of setTracerFactory when configuring the tracer factory.

Comment thread OBSERVABILITY.md
Comment thread OBSERVABILITY.md Outdated
@jinseopkim0

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new observability guide (OBSERVABILITY.md) that explains how to configure OpenTelemetry tracing and SLF4J logging in Google Cloud Java client libraries, and updates the main README.md to link to it. Feedback on the guide suggests correcting the example code to use the standard MyServiceSettings class and the more idiomatic getStubSettingsBuilder() method for configuring the tracer factory.

Comment thread OBSERVABILITY.md Outdated
@jinseopkim0

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a new observability guide (OBSERVABILITY.md) explaining how to configure OpenTelemetry tracing and SLF4J structured logging in Google Cloud Java client libraries, and links to it from the main README.md. Feedback on the documentation points out that trace-log correlation requires explicit MDC propagation (e.g., via the OpenTelemetry Javaagent or an MDC provider dependency) rather than just having an active span, and suggests updating the guide to clarify this requirement.

Comment thread OBSERVABILITY.md Outdated
@jinseopkim0

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new observability guide (OBSERVABILITY.md) that explains how to configure OpenTelemetry tracing and SLF4J logging in Google Cloud Java client libraries, and links to it from the main README.md. Feedback on the guide suggests correcting the artifact ID for the Logback MDC dependency from 'opentelemetry-logback-mdc-provider' to 'opentelemetry-logback-mdc-1.0' to prevent dependency resolution errors.

Comment thread OBSERVABILITY.md Outdated
@jinseopkim0

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Observability Guide (OBSERVABILITY.md) that explains how to enable and configure distributed tracing and structured logging using OpenTelemetry and SLF4J in Google Cloud Java client libraries, and links to this guide from the main README.md. The feedback suggests providing the full Maven dependency coordinates and version for the opentelemetry-logback-mdc-1.0 artifact, as it is not managed by the core OpenTelemetry BOM.

Comment thread OBSERVABILITY.md Outdated
@jinseopkim0

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new observability guide (OBSERVABILITY.md) explaining how to configure OpenTelemetry tracing and SLF4J logging in Google Cloud Java client libraries, and links to it from the README.md. A correction is suggested in the guide's Java code snippet to use stubSettingsBuilder() instead of getStubSettingsBuilder() to avoid a compilation error.

Comment thread OBSERVABILITY.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant